package com.certification.enums;

import lombok.AllArgsConstructor;
import lombok.Getter;

/**
 * @author copa
 * @createDate 2022-03-07 23:40
 * @function
 */
@AllArgsConstructor
@Getter
public enum RoleEnum {

    ROLE_PRINCIPAL(1, "专业负责人", "ROLE_PRINCIPAL"),

    ROLE_EXPERT(2, "认证专家", "ROLE_EXPERT"),

    ROLE_ADMIN(3, "管理员", "ROLE_ADMIN");

    private Integer id;

    private String remark;

    private String roleName;

    public static RoleEnum getRole(Integer id) {
        for (RoleEnum role : RoleEnum.values()) {
            if (role.getId() == id) {
                return role;
            }
        }
        return null;
    }
}
